function [lhs, rhs] = dynamic_resid(y, x, params, steady_state)
T = NaN(16, 1);
lhs = NaN(10, 1);
rhs = NaN(10, 1);
T(1) = (params(4)-1)*params(8)*y(11)/y(15);
T(2) = y(12)^(1-y(20));
T(3) = (y(20)-1)^2;
T(4) = T(2)*log(y(12))/(y(20)-1)+(T(2)-1)/T(3);
T(5) = (params(4)-1)*y(11)/y(15);
T(6) = y(12)^(-y(20));
T(7) = y(22)^(1-y(30));
T(8) = (y(30)-1)^2;
T(9) = params(4)*params(8)*params(1)*(T(7)*log(y(22))/(y(30)-1)+(T(7)-1)/T(8));
T(10) = y(21)/y(13);
T(11) = y(22)^(-y(30));
T(12) = params(1)*T(11);
T(13) = y(3)^params(4);
T(14) = y(15)^(1-params(4));
T(15) = params(4)*y(3)^(params(4)-1);
T(16) = y(15)^(-params(4));
lhs(1) = T(1)*T(4);
rhs(1) = params(2)*y(15)^params(7)+T(5)*T(6);
lhs(2) = T(6)+T(9)*T(10);
rhs(2) = T(12)*(1-params(3)+params(4)*T(10));
lhs(3) = y(20);
rhs(3) = params(6)-params(8)*(y(11)-params(9));
lhs(4) = y(12)+y(14);
rhs(4) = y(11);
lhs(5) = y(11);
rhs(5) = T(13)*exp(y(17))*T(14);
lhs(6) = y(14);
rhs(6) = y(13)-(1-params(3))*y(3);
lhs(7) = y(16);
rhs(7) = y(11)/y(15);
lhs(8) = y(17);
rhs(8) = params(5)*y(7)+x(1);
lhs(9) = y(18);
rhs(9) = T(14)*T(15)-params(3);
lhs(10) = y(19);
rhs(10) = T(13)*(1-params(4))*T(16);
end
